#include<func.h>
#define pipe1 "/tmp/pipe1"
#define pipe2 "/tmp/pipe2"

int main()
{
    mkfifo(pipe1,0600);
    mkfifo(pipe2,0600);

int fdr = open(pipe1,O_RDONLY);
int fdw = open(pipe2,O_WRONLY);
char buf[4096] = {0};
printf("你好\n");
while(1)
{  memset(buf,0,sizeof(buf));
  int ret =read (fdr,buf,sizeof(buf));
  printf("buf=%s\n",buf);memset(buf,0,sizeof(buf));
  int set = read(STDIN_FILENO,buf,sizeof(buf));
  write(fdw,buf,strlen(buf)-1);
 
 
}
close(fdw);
close(fdr);

return 0;
}